export default ({ http }) => ({
  // 初始化
  configInit(response, error) {
    return http.get('/config/init', {}, response, error)
  },

  // 获取机构id
  configSdn(response, error) {
    return http.get('/config/sdn', {}, response, error)
  },

  // 简单上传
  uploadPutFile(query, response, error) {
    return http.post('/upload/putFile', query, response, error, false)
  },

  // 文件秒传
  uploadFast(params) {
    return http.get('/upload/fast', params)
  },

  // 协议
  getAgreementFetch(key, response) {
    return http.get(`/content/agreement/${key}/fetch`, {}, response)
  },

  // 单页
  getSingleFetch(query, response, error) {
    return http.get('/content/single', query, response, error)
  },

  // 课程 - 分类树
  getCategory(query, response, error) {
    return http.get('/category/tree', query, response, error, false)
  },

  // 获取验证码
  createSmsVerify(query, response, error) {
    return http.post('/sms/verify', query, response, error, false)
  },

  // 底部导航
  getNaviBottomList(response) {
    return http.get('/config/navi/bottom/list', {}, response, {})
  },

  // 头部导航
  getNaviTopList(response) {
    return http.get('/config/navi/top/list', {}, response, {})
  },

  // 登录配置
  getConfigLogin(response) {
    return http.get('/config/login', {}, response, {})
  },
  // banner
  getConfigBanner(query, response, error) {
    return http.get('/config/banner', query, response, error)
  },
  // 获取分享信息
  getShareInfo(query, response) {
    return http.get('/share/info', query, response, {}, false)
  },
  // 全局开关
  getConfigSwitch(response) {
    return http.get('/config/switch', {}, response, {}, false)
  }
})
